#ifndef __DB_H_
#define __DB_H_

#include <mysql/mysql.h>
#include <string>

#define SQLMAXSIZE 1024

// 数据库操作类
class MySQL {
public:
    MySQL();
    ~MySQL();
    bool connect();
    bool update(std::string sql);
    MYSQL_RES *query(std::string sql);
    MYSQL *getConnection();
    static void loadConfig();
private:
    MYSQL *m_conn;
    static std::string sm_server;
    static std::string sm_user;
	static std::string sm_password;
	static std::string sm_dbname;
};

#endif // !__DB_H